package com.glsc.ngateway.platform.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author xuchang
 * @date 2023/8/15-17:39
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude
@Builder
public class SystemRelatedFileInfoVo implements Serializable{

    public static final SystemRelatedFileInfoVo EMPTY_LIST = new SystemRelatedFileInfoVo(Collections.emptyList(), Collections.emptyList(), Collections.emptyMap());
    private static final long serialVersionUID = -4381828825615648104L;

    List<FileInfoVo> dirs;

    List<FileInfoVo> allFiles;

    Map<String, List<FileInfoVo>> childrenMap;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonInclude
    @Builder
    public static class FileInfoVo implements Serializable {
        private static final long serialVersionUID = 5899692206155068463L;
        //    @ApiModelProperty(value = "文件信息，string， 文件完整路径")
//    File fileInfo;
        @ApiModelProperty(value = "文件类别，text/doc/docx/ppt等")
        String fileType;
        @ApiModelProperty(value = "文件名")
        String title;
        @ApiModelProperty(value = "生成唯一id")
        String key;
        @ApiModelProperty(value = "生成唯一id")
        String path;
        @ApiModelProperty(value = "父path")
        String parentPath;
        @Builder.Default
        @ApiModelProperty(value = "是否叶子节点")
        Boolean isLeaf = false;
        @ApiModelProperty(value = "大小")
        String size;
        @ApiModelProperty(value = "创建时间")
        String createTime;
        @ApiModelProperty(value = "最近修改时间")
        String lastModifyTime;
        @ApiModelProperty(value = "子目录")
        Set<FileInfoVo> children;
        @ApiModelProperty(value = "子文件")
        List<FileInfoVo> childrenFiles;

        @JsonIgnore
        Long fileid;
        @JsonIgnore
        Long parent;
        @JsonIgnore
        Long level;
    }
}
